![]() |
OpenMixerSoundComponent |
||||
Header: | Sound.h | Carbon status: | Supported | |
Opens and connects a sound output device component to the Apple Mixer component. Intended for use only by sound output components.
OSErr OpenMixerSoundComponent ( SoundComponentDataPtr outputDescription, SInt32 outputFlags, ComponentInstance *mixerComponent );
A description of the data format your sound output device is expecting to receive.
A set of 32 bit flags that provide additional information about the data format your output device is expecting to receive. See
The component instance of the Apple Mixer component. You need this instance to call the SoundComponentGetSourceData and CloseMixerSoundComponent functions.
A result code.
The OpenMixerSoundComponent function opens the standard Apple Mixer component and creates a connection between your sound output device component and the Apple Mixer. If your output device can perform specific operations on the stream of audio data, such as channel mixing and rate conversion, it should call OpenMixerSoundComponent as many times as are necessary to create a unique component chain for each sound source. If, on the other hand, your output device does not perform channel mixing, it should call OpenMixerSoundComponent only once, from its SoundComponentInitOutputDevice function. This opens a single instance of the Apple Mixer component, which in turn manages all the available sound sources.
Your component specifies the format of the data it can handle by filling in a sound component data structure and passing its address in the outputDescription parameter. The sound component data structure specifies the data format as well as the sample rate and sample size expected by the output device component. If these specifications are sufficient to determine the kind of data your component can handle, you should pass the value 0 in the outputFlags parameter. Otherwise, you can set flags in the outputFlags parameter to select certain kinds of input data. For example, you can set the kNoChannelConversion flag to prevent the component chain from converting monophonic sound to stereo sound, or stereo sound to monophonic sound. See
This function should be called only by sound output device components.
The OpenMixerSoundComponent function is available only in versions 3.0 and later of the Sound Manager.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)